{strip}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
{config_load file="main.conf"}
<head>
    <title>{#title#}</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" type="text/css" href="{$design}style/main.css" />
    <link rel="stylesheet" type="text/css" href="{$design}style/head.css" />
    <link rel="stylesheet" type="text/css" href="{$design}style/left.css" />
    <link rel="stylesheet" type="text/css" href="{$design}style/footer.css" />
    <link rel="stylesheet" type="text/css" href="{$design}style/content.css" />
</head>
<body>
    <div id="imageupload" style="display: none"></div>
    <div align="center">
        <div class="Main">
            {include file="global/head.tpl"}
            {include file="global/left.tpl"}
            <div class="Content" align="left">
                <div class="Caption">Действие</div>
                <div class="RealContent">
                    <a href="{$curSiteDir}/{$curPage}">Показать комментарии</a>
                </div>
                {if !isset($smarty.get.action)}
                    <div class="Caption">Комментарии</div>
                    <div class="RealContent">
                        <div class="pages">
                            {foreach item=item from=$currentComments}
                                <div class="page">
                                    {$item.username}
                                    <a href="{$curSiteDir}/{$curPage}?newid={$smarty.get.newid}&commentid={$item.commentid}&action=delete">Удалить</a>
                                    <a href="{$curSiteDir}/{$curPage}?newid={$smarty.get.newid}&commentid={$item.commentid}&action=change">Изменить</a>
                                </div>
                            {/foreach}
                        </div>
                    </div>
                {/if}
                
                {if $smarty.get.action == "change"}
                    <div class="Caption">Изменение комментария</div>
                    <div class="RealContent">
                        <form class="block" method="post" action="{$curSiteDir}/{$curPage}?newid={$smarty.get.newid}">

                            <div class="inputBlock">
                                <p>
                                    Имя пользователя
                                </p>
                                <input name="username" type="text" value="{$currentComment.username}" />
                            </div>

                            <br clear="left" />

                            <div class="inputBlock">
                                <p>
                                    Текст комментария
                                </p>
                                <textarea class="maintext" name="maintext">
                                    {$currentComment.maintext}
                                </textarea>
                            </div>
                            <br clear="left" />

                            <input type="text" style="display: none;" value="{$currentComment.commentid}" name="commentid" />

                            <br />
                            <input type="submit" value="Изменить" name="commentChangeEnter" />
                            <input type="reset" value="Очистить" />
                            <input type="submit" value="Отмена" name="cancel" />
                        </form>
                    </div>
                {/if}
                
                {if $smarty.get.action == "delete"}
                    <div class="Caption">Удаление комментария {$currentComment.username}</div>
                    <div class="RealContent">
                        <form class="block" method="post" action="{$curSiteDir}/{$curPage}?newid={$smarty.get.newid}">
                            <input type="text" style="display: none;" value="{$currentComment.commentid}" name="commentid" />
                            <p>Действительно ли Вы хотите удалить комментарий {$currentComment.username}?</p>
                            <br />
                            <input type="submit" value="Отмена" name="cancel" />
                            <input type="submit" value="Удалить" name="commentDeleteEnter" />
                        </form>
                    </div>
                {/if}
                
            </div>
            <br clear="left" />
            {include file="global/footer.tpl"}
        </div>
    </div>
</body>
</html>
{/strip}